local lsp_gangban = fk.CreateSkill {
    name = "lsp_gangban",
    tags = { Skill.Compulsory }
}

Fk:loadTranslationTable {
    ["lsp_gangban"] = "钢板",
    [":lsp_gangban"] = "锁定技，防止你受到的非属性伤害；受到雷电伤害时，此伤害+1，然后你增加一点体力上限，摸X张牌(X为你的体力上限)。",

    ["@@lsp_gangban-inhand"] = "钢板",
}
lsp_gangban:addEffect(fk.DetermineDamageInflicted, {
    anim_type = "defensive",
    can_trigger = function(self, event, target, player, data)
        if target == player and player:hasSkill(lsp_gangban.name) then
            if player:getMark("lsp_chongqi") == 0 then
                return data.damageType == fk.NormalDamage or data.damageType == fk.ThunderDamage
            else
                return true
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        if data.damageType == fk.NormalDamage then
            data:preventDamage()
        else
            local n = 0
            if player:getMark("lsp_chongqi") == 0 then
                n = player.maxHp
            else
                n = player.maxHp + 1
            end
            data:changeDamage(1)
            room:changeMaxHp(player, 1)
            local cards = player:drawCards(n, lsp_gangban.name)
            for _, id in ipairs(cards) do
                room:setCardMark(Fk:getCardById(id), "@@lsp_gangban-inhand", 1)
            end
            if player:getMark("lsp_chongqi") ~= 0 then
                room:setPlayerMark(player, "lsp_chongqi", 0)
            end
        end
    end,
})

return lsp_gangban
